package com.atsongyr.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 规则类
 * Ribbon 自定义规则，不可被ComponentScan 同级及起子集扫描到。遂新建此包此类
 * 主启动类添加@RibbonClient
 * @author songyurui
 * */
@Configuration
public class MySelfRule {
    @Bean
    public IRule myRule() {
        // 定位随机
        return new RandomRule();
    }
}
